<?php
/*code here*/
/* If user click the button/link to logged out. */
$db = new Database();
$auth = Auth::getAuth('current_user');
$destroy = Auth::destroyAuth('current_user');
if($destroy){
    header('location: /');
    // Audit Trail
    $insert = array("userID"=>$auth['userID'],
                    "actionID"=>2,
                    "affectedTable"=>"users",
                    "datetime"=>date("Y-m-d  H:i:s")
                    );
     $db->insert("audit_trail",$insert);
}
/*code here(end)*/
exit;
$this->setLayout();
